<template>
  <div class="login-container">
    <div class="header-container"></div>
    <div class="main-container">
      <div class="ui-body">
        <div class="info-card">
          <div class="info-content">
            <div class="info_logo">
              <img alt="logo" src="@/assets/vite.svg" />
              <span class="info_logo_text">RanDi</span>
            </div>
            <h2 class="info_title">快速开发管理平台框架</h2>
          </div>
        </div>
        <div class="form-card">
          <div class="form_header">
            <h2 class="form_header_title">登录</h2>
          </div>
          <div class="form_body">
            <FormUserName />
          </div>
        </div>
      </div>
    </div>
    <div class="footer-container"></div>
  </div>
</template>

<script setup>
import { FormUserName } from './modules';
</script>

<style lang="scss" scoped>
@import '@/styles/config.scss';

.login-container {
  width: 100%;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 16px;
  overflow: hidden;
  background: url('@/assets/login/bg.jpg') center no-repeat;
  background-size: cover;

  .header-container {
    width: 100%;
    height: 53px;
  }

  .footer-container {
    width: 100%;
    height: 100px;
  }
}

.main-container {
  width: 100%;
  flex-grow: 1;
  display: flex;
  justify-content: center;
  padding-top: 4vh;

  .ui-body {
    width: auto;
    height: 480px;
    background-color: #fff;
    box-shadow: 0 20px 80px 0 rgba(0, 0, 0, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s;

    .info-card {
      width: 440px;
      height: 100%;
      position: relative;
      padding: 64px;
      color: #fff;
      overflow: hidden;
      transition: all 0.3s;

      &::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        bottom: 0;
        right: 0;
        background: url('@/assets/login/info-bg.png') center no-repeat;
        background-size: cover;
      }

      .info-content {
        opacity: 1;
        width: 100%;
        position: relative;
        z-index: 1;
        display: flex;
        flex-direction: column;
        gap: 16px;
        transition: opacity 0.3s;

        .info_logo {
          display: flex;
          align-items: center;
          gap: 16px;
          user-select: none;

          .info_logo_text {
            font-size: 32px;
            font-weight: 600;
          }
        }

        .info_title {
          width: min-content;
          white-space: nowrap;
        }
      }
    }

    .form-card {
      width: 400px;
      height: 100%;
      padding: 64px;
      display: flex;
      flex-direction: column;
      gap: 16px;
      transition: all 0.3s;

      .form_body {
        padding: 16px 0;
      }
    }

    @include respond-to('notebook') {
      height: 480px;

      .info-card {
        width: 400px;
        padding: 64px 40px;
      }

      .form-card {
        width: 360px;
        padding: 64px 40px;
      }
    }

    @include respond-to('pad') {
      height: 480px;

      .info-card {
        width: 0;
        padding: 40px 0;

        .info-content {
          opacity: 0;
        }
      }

      .form-card {
        width: 360px;
        padding: 64px 40px;
      }
    }

    @include respond-to('phone') {
      height: 440px;

      .info-card {
        width: 0;
        padding: 40px 0;

        .info-content {
          opacity: 0;
        }
      }

      .form-card {
        width: 360px;
        padding: 40px;
      }
    }
  }
}
</style>
